Use copy(deepcopy=true) for checkpointing#172
Conversation
|
Before I start working on the TODOs of this PR, I wanted to understand what was going on here since I didn't experience any issues in the partitioned heat tutorial. Tests (without the suggested fix)
What's wrong with
|
|
Since the odd behavior isn't solely restricted to the OpenFOAM-FEniCS perpendicular flap tutorial but also to cases where the FEniCS adapter isn't used at all, my guess would be that there is a bug elsewhere as well. What do you think? |
The OpenFOAM-OpenFOAM failure definitely makes this more confusing. Otherwise I could imagine that something goes wrong in the Python bindings, and hence all Python-based participants produce failures. |
|
I could imagine that you have two independent issues here. Maybe ignoring OpenFOAM for the moment is the more sane strategy. |
|
@NiklasVin I assume you already did this: Can you also do the experiment from above including the changes from precice/tutorials#554 but without |
Exactly. I tested it without |
|
Based on the current state I would still suggest to merge this PR and use @IshaanDesai, @uekerman, @NiklasVin: Any comments? If not, I would like to merge this PR. |
|
Makes sense, lets merge this 👍 |
|
A short comment regarding the performance aspect: I tested the runtime of copying a dolfin function both with and without deep-copying. On average, the deep-copy variant is about 13% slower (only copying the function, not the whole execution of the simulation). So, the overall runtime shouldn't be affected too much, at least, it wasn't when comparing precice/tutorials#554 with the suggested changes here. |
NiklasVin
left a comment
There was a problem hiding this comment.
The changes look good to me. 👍
I am opening an issue regarding the crash of the OpenFOAM-OpenFOAM example from above.


There seems to be a bug when using checkpointing. I stumbled across this with subcycling:
solid.pyby settingfenics_dt = precice_dt / 10. Here, OpenFOAM runs into an exception after some time. The vtk files also start to obviously look faulty after some time.Looking at the value of
u_nin any of these cases shows that we do not correctly load the checkpoint we originally stored. I assume there is some unintended pointer-magic happening. I used the following debugging statements insolid.pyto sample the solution at the tip of the flap:The fixes applied here seem to avoid the error.
There are still some todos: